package ConnectWordsTool;

import java.util.ArrayList;

/**
 * Represents a exercise.
 * @author Knut
 */
class ConnectWordsExercise {
	/**
	 * The pages in the exercise
	 */
	private ArrayList<ConnectWordsPage> pages = new ArrayList<ConnectWordsPage>();
	
	/**
	 * A score array list. This is managed by RunExercisePanel and also
	 * read by DisplayScorePanel. 
	 */
	public ArrayList<Integer> scores = new ArrayList<Integer>();
	
	/**
	 * Add a page to the exercise
	 * @param page
	 */
	public void addPage(ConnectWordsPage page) {
		pages.add(page);
	}
	
	/**
	 * Get a page from the exercise
	 * @param index
	 * @return
	 */
	public ConnectWordsPage getPage(int index) {
		if (pages.size()-1 < index) {
			return null;
		}
		
		return pages.get(index);
	}
	
	/**
	 * Counts how many pages there are.
	 * @return
	 */
	public int numPages() {
		return pages.size();
	}
}